package com.example.personnel_oa.service.impl;
//service 接口 服务层
import com.example.comment_oa.pojos.Dimission;
import com.example.comment_oa.pojos.SysEmployee;
import com.example.personnel_oa.mapper.DimissionMapper;
import com.example.personnel_oa.service.DimissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
* @author HUAWEI
* @description 针对表【dimission】的数据库操作Service实现
* @createDate 2022-10-19 16:39:55
*/
@Service
public class DimissionServiceImpl implements DimissionService {
    @Autowired//Spring对组件自动装配（Spring通过依赖注入通过IOC容器中各种组件的依赖关系赋值）的方法
    DimissionMapper dimissionMapper;
    //调mapper接口
    @Override
    public List<Dimission> Methods_dim(){
        List<Dimission> dimissions = dimissionMapper.Methods_dim();
        return  dimissions;
    }
    @Override
    public List<SysEmployee> allDimission(){
        List<SysEmployee> sysEmployees = dimissionMapper.allDimission();
        return sysEmployees;
    }
    @Override
    public List<Dimission> allrelieve(int dimId){

        return dimissionMapper.allrelieve(dimId);
    }

    //新增离职申请数据
    @Override
    public int shenqinglizhi(Dimission dimission) {
        int shenqinglizhi = dimissionMapper.shenqinglizhi(dimission);
        return shenqinglizhi;
    }

    //根据编号查询离职审批数据详情
    @Override
    public Dimission dimBiaanhao(String dimBianhao) {
        Dimission dimission = dimissionMapper.dimBiaanhao(dimBianhao);
        return dimission;
    }

    //离职审批成功
    @Override
    public int dimState(String dimName, String dimBianhao) {
        int i = dimissionMapper.dimState(dimName, dimBianhao);
        return i;
    }

    //离职审批失败
    @Override
    public int dimStates(String dimName, String dimBianhao) {
        int i = dimissionMapper.dimStates(dimName, dimBianhao);
        return i;
    }

}




